- import_playbook: "/srv/web/infra/ansible/playbooks/include/virt-create.yml myhosts=log01.phx2.fedoraproject.org"

- name: make the box be real
  hosts: log01.phx2.fedoraproject.org
  user: root
  gather_facts: True

  vars_files:
   - /srv/web/infra/ansible/vars/global.yml
   - "/srv/private/ansible/vars.yml"
   - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml

  roles:
  - base
  - rkhunter
  - nagios_client
  - hosts
  - fas_client
  - apache
  - collectd/base
  - collectd/server
  - sudo
  - epylog
  - openvpn/client
  - awstats
  - role: keytab/service
    owner_user: apache
    owner_group: apache
    service: HTTP
    host: "admin.fedoraproject.org"
    when: env == "production"

  tasks:
  - import_tasks: "{{ tasks_path }}/yumrepos.yml"
  - import_tasks: "{{ tasks_path }}/2fa_client.yml"
  - import_tasks: "{{ tasks_path }}/motd.yml"

#
# We exclude some dirs from restorecon on updates on logservers as they are very large
# and it takes a long long time to run restorecon over them.
#
  - name: exclude some directories from selinux relabeling on updates
    copy: src="{{ files }}/logserver/fixfiles_exclude_dirs" dest=/etc/selinux/fixfiles_exclude_dirs owner=root mode=0644

  handlers:
  - import_tasks: "{{ handlers_path }}/restart_services.yml"

- name: Cloud Image stats
  hosts: log01.phx2.fedoraproject.org
  user: root
  gather_facts: False

  vars_files:
   - /srv/web/infra/ansible/vars/global.yml
   - "/srv/private/ansible/vars.yml"
   - /srv/web/infra/ansible/vars/{{ ansible_distribution }}.yml

  roles:
  - cloudstats
  - role: nfs/client
    mnt_dir: '/mnt/fedora_stats'
    nfs_mount_opts: "rw,hard,bg,intr,noatime,nodev,nosuid,sec=sys,nfsvers=3"
    nfs_src_dir: 'fedora_stats'

  handlers:
  - import_tasks: "{{ handlers_path }}/restart_services.yml"
